package com.tuanzi.loan.web.lazy.credit;

import com.tuanzi.loan.business.service.credit.LoanCreditOrderService;
import com.tuanzi.loan.core.lazy.BaseLazyDataModel;
import com.tuanzi.loan.core.util.SpringContextHolder;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.credit.LoanCreditOrderRequest;
import com.tuanzi.loan.vo.response.credit.LoanCreditOrderResponse;
import org.springframework.data.domain.Page;

/**
 * User: liangZongXi
 * Create time: 10:59 2019/9/17
 * Description:
 */
public class LoanCreditOrderListLazyDataModel extends BaseLazyDataModel<LoanCreditOrderRequest, LoanCreditOrderResponse> {
    private static final long serialVersionUID = -5975903068470307754L;

    private LoanCreditOrderService loanCreditOrderService = SpringContextHolder.getBean(LoanCreditOrderService.class);

    public LoanCreditOrderListLazyDataModel(LoanCreditOrderRequest loanCreditOrderRequest) {
        super(loanCreditOrderRequest);
    }

    @Override
    protected Page<LoanCreditOrderResponse> doLoad(PageSearcher<LoanCreditOrderRequest> pageSearcher) {
        return loanCreditOrderService.listOrder(pageSearcher);
    }
}
